// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    swiper: [],
    goods: []
  },

  onLoad() {
    let that = this
    //请求轮播图
    wx.request({
      url: 'http://120.79.28.228:5000/swiper',
      success(res){
        // console.log(res.data)
        that.setData({
          swiper: res.data
        })
      },
      fail(err){
        console.log(err)
      }
    })
    //首页商品
    wx.request({
      url: 'http://120.79.28.228:5000/main_key',
      success(res){
        // console.log(res.data)
        that.setData({
          goods: res.data
        })
        console.log(res.data)
      },
      fail(err){
        console.log(err)
      }
    })


  }
})
